package com.qying.rpc.serialzation;

public class SerialzationFactory {

    public static RpcSerialzation getRpcSerialZation(byte serialzationType) {
        SerialzationTypeEnum byType = SerialzationTypeEnum.findByType(serialzationType);

        switch (byType) {
            case JSON:
                return new JsonSerialzation();
            case HESSIAN:
                return new HessianSerialization();
            default:
                throw new IllegalArgumentException("serialzayion args error");
        }
    }
}
